- if @photo
  - unless @gallery.is_approved?
    - if @photo.approved_in?(@gallery)
      approve |
      = link_to_remote "decline", :url => {:action => :decline, :controller => :approvals, :approval => {:photo_id => @photo.id, :gallery_id => @gallery.id, :user_id => current_user.id}}, :update => "photo_#{@photo.id.to_s}_approval", :html => {:class => "MultiBoxCloseFromLink", :title => "Decline this photo", :onclick => ((@photo == @gallery.all_items.last) ? "box.close(); $('photo_approval_#{@photo.id.to_s}').removeClass('photo_approved'); $('photo_approval_#{@photo.id.to_s}').addClass('photo_declined')" : "box.next(); $('photo_approval_#{@photo.id.to_s}').removeClass('photo_declined'); $('photo_approval_#{@photo.id.to_s}').addClass('photo_approved')")}
    - elsif @photo.declined_in?(@gallery)                                                                                                                                                                                                                                                                                                                                
      = link_to_remote "approve", :url => {:action => :approve, :controller => :approvals, :approval => {:photo_id => @photo.id, :gallery_id => @gallery.id, :user_id => current_user.id}}, :update => "photo_#{@photo.id.to_s}_approval", :html => {:class => "MultiBoxCloseFromLink", :title => "Approve this photo", :onclick => ((@photo == @gallery.all_items.last) ? "box.close(); $('photo_approval_#{@photo.id.to_s}').removeClass('photo_declined'); $('photo_approval_#{@photo.id.to_s}').addClass('photo_approved')" : "box.next(); $('photo_approval_#{@photo.id.to_s}').removeClass('photo_declined'); $('photo_approval_#{@photo.id.to_s}').addClass('photo_approved')")}
      | decline                                                                                                                                                                                                                                                                                                                                                          
    - else                                                                                                                                                                                                                                                                                                                                                               
      = link_to_remote "decline", :url => {:action => :decline, :controller => :approvals, :approval => {:photo_id => @photo.id, :gallery_id => @gallery.id, :user_id => current_user.id}}, :update => "photo_#{@photo.id.to_s}_approval", :html => {:class => "MultiBoxCloseFromLink", :title => "Decline this photo", :onclick => ((@photo == @gallery.all_items.last) ? "box.close(); $('photo_approval_#{@photo.id.to_s}').removeClass('photo_approved'); $('photo_approval_#{@photo.id.to_s}').addClass('photo_declined')" : "box.next(); $('photo_approval_#{@photo.id.to_s}').removeClass('photo_declined'); $('photo_approval_#{@photo.id.to_s}').addClass('photo_approved')")}
      |                                                                                                                                                                                                                                                                                                                                                                  
      = link_to_remote "approve", :url => {:action => :approve, :controller => :approvals, :approval => {:photo_id => @photo.id, :gallery_id => @gallery.id, :user_id => current_user.id}}, :update => "photo_#{@photo.id.to_s}_approval", :html => {:class => "MultiBoxCloseFromLink", :title => "Approve this photo", :onclick => ((@photo == @gallery.all_items.last) ? "box.close(); $('photo_approval_#{@photo.id.to_s}').removeClass('photo_declined'); $('photo_approval_#{@photo.id.to_s}').addClass('photo_approved')" : "box.next(); $('photo_approval_#{@photo.id.to_s}').removeClass('photo_declined'); $('photo_approval_#{@photo.id.to_s}').addClass('photo_approved')")} 
  - else
    - if @photo.approved_in?(@gallery)
      This photo was approved.
    - elsif @photo.declined_in?(@gallery)
      This photo was declined.
    - else
      This photo was not reviewed.
- elsif @video
  - unless @gallery.is_approved?
    - if @video.approved_in?(@gallery)
      approve |
      = link_to_remote "decline", :url => {:action => :decline, :controller => :approvals, :approval => {:video_id => @video.id, :gallery_id => @gallery.id, :user_id => current_user.id}}, :update => "video_#{@video.id.to_s}_approval", :html => {:class => "MultiBoxCloseFromLink", :title => "Decline this video", :onclick => ((@video == @gallery.all_items.last) ? "box.close(); $('video_approval_#{@video.id.to_s}').removeClass('video_approval_approved'); $('video_approval_#{@video.id.to_s}').addClass('video_declined')" : "box.next(); $('video_approval_#{@video.id.to_s}').removeClass('video_approved'); $('video_approval_#{@video.id.to_s}').addClass('video_declined')")}
    - elsif @video.declined_in?(@gallery)                                                                                                                                                                                                                                                                                                                                
      = link_to_remote "approve", :url => {:action => :approve, :controller => :approvals, :approval => {:video_id => @video.id, :gallery_id => @gallery.id, :user_id => current_user.id}}, :update => "video_#{@video.id.to_s}_approval", :html => {:class => "MultiBoxCloseFromLink", :title => "Approve this video", :onclick => ((@video == @gallery.all_items.last) ? "box.close(); $('video_approval_#{@video.id.to_s}').removeClass('video_approval_declined'); $('video_approval_#{@video.id.to_s}').addClass('video_approved')" : "box.next(); $('video_approval_#{@video.id.to_s}').removeClass('video_declined'); $('video_approval_#{@video.id.to_s}').addClass('video_approved')")}
      | decline                                                                                                                                                                                                                                                                                                                                                          
    - else                                                                                                                                                                                                                                                                                                                                                               
      = link_to_remote "decline", :url => {:action => :decline, :controller => :approvals, :approval => {:video_id => @video.id, :gallery_id => @gallery.id, :user_id => current_user.id}}, :update => "video_#{@video.id.to_s}_approval", :html => {:class => "MultiBoxCloseFromLink", :title => "Decline this video", :onclick => ((@video == @gallery.all_items.last) ? "box.close(); $('video_approval_#{@video.id.to_s}').removeClass('video_approval_approved'); $('video_approval_#{@video.id.to_s}').addClass('video_declined')" : "box.next(); $('video_approval_#{@video.id.to_s}').removeClass('video_approved'); $('video_approval_#{@video.id.to_s}').addClass('video_declined')")}
      |                                                                                                                                                                                                                                                                                                                                                                  
      = link_to_remote "approve", :url => {:action => :approve, :controller => :approvals, :approval => {:video_id => @video.id, :gallery_id => @gallery.id, :user_id => current_user.id}}, :update => "video_#{@video.id.to_s}_approval", :html => {:class => "MultiBoxCloseFromLink", :title => "Approve this video", :onclick => ((@video == @gallery.all_items.last) ? "box.close(); $('video_approval_#{@video.id.to_s}').removeClass('video_approval_declined'); $('video_approval_#{@video.id.to_s}').addClass('video_approved')" : "box.next(); $('video_approval_#{@video.id.to_s}').removeClass('video_declined'); $('video_approval_#{@video.id.to_s}').addClass('video_approved')")}
  - else
    - if @video.approved_in?(@gallery)
      This video was approved.
    - elsif @video.declined_in?(@gallery)
      This video was declined.
    - else
      This video was not reviewed.